FROM docker.jianmuhub.com/library/alpine:3.17.0
ARG TARGETOS
ARG TARGETARCH
ADD ./${TARGETOS}/${TARGETARCH}/jianmu-worker-kube /jianmu-worker-kube
ADD version /version
ENTRYPOINT ["/jianmu-worker-kube"]
CMD ["daemon"]

HEALTHCHECK --interval=5s --timeout=3s CMD PID=`ps  -ef  | grep jianmu-worker-docker | grep -v grep  | awk   '{print $2}' ` ; \
[[ `ps -o etimes= $PID` -gt $JIANMU_WORKER_REGISTER_TIMEOUT ]] && exit 0 || exit 1

